package com.xzr.hospitalregister.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.xzr.hospitalregister.R;

import java.util.List;

/**
 * Created by Administrator on 2018/2/2.
 */

public class AdapterDialogLastestVersionAppRemindContent extends RecyclerView.Adapter<AdapterDialogLastestVersionAppRemindContent.MyHolder> {
    private List<String> data;
    private Context context;

    public AdapterDialogLastestVersionAppRemindContent(List<String> data, Context context) {
        this.data = data;
        this.context = context;
    }

    @Override
    public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new MyHolder(LayoutInflater.from(context).inflate(R.layout.dialog_lastest_version_app_remind_content_list_item, null));
    }

    @Override
    public void onBindViewHolder(MyHolder holder, int position) {
        holder.content.setText(data.get(position));
    }

    @Override
    public int getItemCount() {
        return data.size();
    }

    class MyHolder extends RecyclerView.ViewHolder {
        private TextView content;

        public MyHolder(View itemView) {
            super(itemView);
            content = (TextView) itemView.findViewById(R.id.tv_dialog_lastest_version_app_remind_content_list_item_content);
        }
    }
}
